<!-- 自定义的登录对话框 使用同CaDialog 该组件主要是使LoginView不要太繁琐 -->
<template>
	<PopupView ref="login" type="center">
		<LoginVue :blockAction="onSuccess"/>
	</PopupView>
</template>

<script>
	
	import base from '@/components/index.vue'
	import LoginVue from '@/workbench/login.vue'
	
	export default {
		extends: base,
		emits: ['success'],
		components: {
			LoginVue
		},
		data() {
			return {
				callback: undefined
			}
		},
		mounted() {
			
		},
		methods: {
			open(callback) {
				this.callback = callback
				this.$refs.login.open()
			},
			close() {
				this.$refs.login.close()
			},
			onSuccess(res) {
				this.callback && this.callback(res)
				this.$emit('success', res)
				this.close()
			}
		}
	}
</script>

<style>
</style>